import React, {Component} from 'react';
import storageUtil from "../../../utils/storageUtil";
import {Button, Descriptions} from "antd";

class ManagerInfo extends Component {
    render() {
        const manager = storageUtil.getServicer();

        const logout = () => {
            storageUtil.delServicer();
            this.props.history.push('/login')
        }

        return (
            <div>
                <Descriptions title="用户信息">
                    <Descriptions.Item label="用户名">{manager.username}</Descriptions.Item>
                    <Descriptions.Item label="联系方式">{manager.phone}</Descriptions.Item>
                    <Descriptions.Item label="电子邮箱">{manager.email}</Descriptions.Item>
                </Descriptions>
                <Button
                    style={{marginTop: '100px',float: 'right'}}
                    onClick={logout}
                    type="primary">退出登录</Button>
            </div>
        );
    }
}

export default ManagerInfo;